# Maintainer: Alexey Pavlov <alexpux@gmail.com>

_realname=Path-Class
pkgname=perl-${_realname}
pkgver=0.37
pkgrel=1
pkgdesc="Cross-platform path specification manipulation for Perl"
arch=('any')
url="https://metacpan.org/release/Path-Class"
groups=('perl-modules')
license=('PerlArtistic' 'GPL')
options=('!emptydirs')
depends=('perl')
source=("https://www.cpan.org/authors/id/K/KW/KWILLIAMS/${_realname}-${pkgver}.tar.gz")
sha256sums=('654781948602386f2cb2e4473a739f17dc6953d92aabc2498a4ca2561bc248ce')

build() {
  export PERL_MM_USE_DEFAULT=1 PERL5LIB=""                 \
    PERL_AUTOINSTALL=--skipdeps                            \
    PERL_MM_OPT="INSTALLDIRS=vendor"     \
    PERL_MB_OPT="--installdirs vendor" \
    MODULEBUILDRC=/dev/null

  cd ${_realname}-${pkgver}
  /usr/bin/perl Makefile.PL
  make
}

check() {
  export PERL_MM_USE_DEFAULT=1 PERL5LIB=""
  cd ${_realname}-${pkgver}
  make test
}

package() {
  cd ${_realname}-${pkgver}
  make DESTDIR="$pkgdir" install
}
